<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>
	
  Deploying a Visual Studio Tools for the Office System 3.0 Solution for
 the 2007 Microsoft Office System Using Windows Installer (Part 2 of 2)

</title><link 
href="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/064bc0ac7f2dacac51404ce41f8aa35b.css"
 rel="stylesheet" type="text/css"><link rel="alternate" media="print" 
href="http://msdn.microsoft.com/en-us/library/cc616991%28d=printer,v=office.12%29.aspx"><meta
 name="DCS.dcsuri" 
content="/en-us/library/cc616991(d=lightweight,l=en-us,v=office.12).aspx"><meta
 name="NormalizedUrl" 
content="http://msdn.microsoft.com/en-us/library/cc616991(d=lightweight,l=en-us,v=office.12).aspx"><meta
 name="DCSext.Title" content="Deploying a Visual Studio Tools for the 
Office System 3.0 Solution for the 2007 Microsoft Office System Using 
Windows Installer (Part 2 of 2)"><meta name="DCSext.ContentType" 
content="MSDN_OFFICETECHARTICLE"><meta name="DCSext.Product" 
content="MSDN_OFFICEVSTO"><meta name="DCSext.ProductFamily" 
content="MSDN_OFFICE"><meta name="VotingContextUrl" 
content="http://msdn.microsoft.com/en-us/library/cc616991(d=lightweight,l=en-us,v=office.12).aspx"><meta
 name="MN" content="D1DC1169-3:26:40 PM"><meta name="Search.ShortId" 
content="cc616991"><meta name="Ms.Locale" content="en-us"></head><body><div
 class="header"><table class="headerBar cl_lightweight_topnav_slice" 
border="0" cellpadding="0" cellspacing="0"><tbody><tr><td 
class="leftSection cl_lightweight_header_leftSection_wave 
leftSectionImageClusterOverride"><div class="tabContainer"><a 
href="http://msdn.microsoft.com/en-us/" title="Home" class=" headerTab">Home</a><a
 href="http://msdn.microsoft.com/en-us/library" title="Library" 
class="headerTabSelected cl_lightweight_selected_tab_repeatX ">Library</a><a
 href="http://msdn.microsoft.com/en-us/bb188199.aspx" title="Learn" 
class=" headerTab">Learn</a><a 
href="http://msdn.microsoft.com/en-us/aa570309.aspx" title="Downloads" 
class=" headerTab">Downloads</a><a 
href="http://msdn.microsoft.com/en-us/aa570318.aspx" title="Support" 
class=" headerTab">Support</a><a 
href="http://msdn.microsoft.com/en-us/aa497440.aspx" title="Community" 
class=" headerTab">Community</a></div></td><td class="rightSection 
cl_lightweight_header_rightSection_wave 
rightSectionImageClusterOverride"><div class="tabContainer"><a 
href="http://login.live.com/login.srf?wa=wsignin1.0&amp;rpsnv=11&amp;ct=1284762400&amp;rver=6.0.5276.0&amp;wp=MCLBI&amp;wlcxt=msdn%24msdn%24msdn&amp;wreply=http:%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fcc616991%2528office.12%2529.aspx&amp;lc=1033&amp;cb=&amp;id=254354"
 title="Sign in">Sign in </a><span class="pipe">|</span><a 
href="http://msdn.microsoft.com/en-us/library/preferences/locale/?returnurl=%252fen-us%252flibrary%252fcc616991%28v%253doffice.12%29.aspx"
 title="United States - English">United States - English </a><span 
class="pipe">|</span><a 
href="http://msdn.microsoft.com/en-us/library/preferences/experience/?returnurl=%252fen-us%252flibrary%252fcc616991%28v%253doffice.12%29.aspx"
 title="Preferences">Preferences</a></div></td></tr></tbody></table></div><div
 class="contentPlaceHolder"><div class="navigation" id="Navigation" 
style="width: 0px;"><div class="searchcontainer"><form id="SearchForm" 
action="http://social.msdn.microsoft.com/Search/en-us" method="get" 
style="margin: 0pt; padding: 0pt;"><div class="searchBoxContainer" 
style=""><table class="searchBox" border="0" cellpadding="0" 
cellspacing="0"><tbody><tr><td><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"
 class="cl_lt_search" alt=""></td><td class="searchTextBoxTd 
cl_slice_Search"><input id="Text1" maxlength="200" class="searchTextBox"
 name="query" value="Search MSDN with Bing" onfocus="document.onkeydown =
 ''; WatermarkFocus(this, 'Search MSDN with Bing', 'searchTextBoxTrue') "
 onblur="document.onkeydown = Presskey;WatermarkBlur(this, 'Search MSDN 
with Bing', 'searchTextBox')" type="text"></td><td class="searchButtonTd
 cl_slice_Search"><a href="#" style="display: block; overflow: hidden; 
width: 19px; height: 19px; position: relative; padding: 0pt; margin: 
0pt;" 
onclick="javascript:document.getElementById('SearchForm').submit();"><img
 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 class="cl_search_icon" style="position: relative;" title="Search" 
alt="Search"></a></td><td><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"
 class="cl_rt_search" alt=""></td></tr></tbody></table></div></form></div><div
 class="navcontainer"><div class="nav"><div class="toclevel0 ancestry"><div
 class="clip5x9 nav_root"><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 class="cl_nav_bullet" alt=""></div><div class="nav_div_currentroot"><a 
href="http://msdn.microsoft.com/en-us/library/ms123401.aspx" title="MSDN
 Library">MSDN Library</a></div><div class="clip5x9 nav_arrows"><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 class="cl_nav_arrow" alt=""></div><div class="nav_div_currentroot"><a 
href="http://msdn.microsoft.com/en-us/library/bb726434%28v=office.12%29.aspx"
 title="Office Development">Office Development</a></div><div 
class="clip5x9 nav_arrows"><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 class="cl_nav_arrow" alt=""></div><div class="nav_div_currentroot"><a 
href="http://msdn.microsoft.com/en-us/library/bb726436%28v=office.12%29.aspx"
 title="2007 Microsoft Office System">2007 Microsoft Office System</a></div><div
 class="clip5x9 nav_arrows"><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 class="cl_nav_arrow" alt=""></div><div class="nav_div_currentroot"><a 
href="http://msdn.microsoft.com/en-us/library/bb871648%28v=office.12%29.aspx"
 title="Visual Studio Tools for the Office System (3.0)">Visual Studio 
Tools for the Office System (3.0)</a></div><div class="clip5x9 
nav_arrows"><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 class="cl_nav_arrow" alt=""></div><div class="nav_div_currentroot"><a 
href="http://msdn.microsoft.com/en-us/library/dd186137%28v=office.12%29.aspx"
 title="Technical Articles">Technical Articles</a></div></div><div 
class="clip13x9 nav_dots_current"><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 class="cl_nav_dots" alt=""></div><div class="toclevel1 current"><a 
href="http://msdn.microsoft.com/en-us/library/cc616991%28v=office.12%29.aspx"
 title="Deploying a Visual Studio Tools for the Office System 3.0 
Solution for the 2007 Microsoft Office System Using Windows Installer 
(Part 2 of 2)">Deploying a Visual Studio Tools for the Office System 3.0
 Solution for the 2007 Microsoft Office System Using Windows Installer 
(Part 2 of 2)</a></div><div class="toclevel2 children" 
style="border-bottom: 1px solid rgb(187, 187, 187);"></div><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"
 alt="Separator" class="communityContentNavigationSeparator 
cl_lt_cc_line_top"><div class="communityContentNavigation"><div 
class="communityContentNavigationHeader">Community Content</div><div 
class="communityContentNavigationPost"><div 
class="communityContentNavigationAvatarContainer"><a 
class="communityContentNavigationLinkAvatar" href="#4" title=""><img 
alt="" class="cl_default_avatar" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/Image_003.avatr"></a></div><div
 class="communityContentNavigationLink"><ul><li><a href="#4" title="">Missing
 spaces for Document-leve...</a></li><li>Step 11 of "Additional 
Requireme...</li></ul></div></div><div 
class="communityContentNavigationPost"><div 
class="communityContentNavigationAvatarContainer"><a 
class="communityContentNavigationLinkAvatar" href="#3" title=""><img 
alt="" class="cl_default_avatar" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/Image_002.avatr"></a></div><div
 class="communityContentNavigationLink"><ul><li><a href="#3" title="">How
 to install Addins for all us...</a></li><li>This post should be part of
 the ...</li></ul></div></div><div 
class="communityContentNavigationMoreLink"><a href="#CommunityContent" 
title="More...">More...</a></div></div></div></div></div><a href="#" 
onclick="onIncreaseToc()" class="tocResize" id="TocResize" style="left: 
0px;"><img id="ResizeImageIncrease" class="cl_nav_resize_open" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 onmousedown="onIncreaseToc()" title="Expand" alt="Expand"><img 
id="ResizeImageReset" class="cl_nav_resize_close" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 style="display: none;" onmousedown="onResetToc()" title="Minimize" 
alt="Minimize"></a><div class="content"><div class="clip117x31 logo"><a 
href="http://msdn.microsoft.com/en-us/library/default.aspx"><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 class="msdn_body_logo" alt="" title=""></a></div><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/4af07a4b382aa20acda1ffb4bb75c973.png"
 class="TOC_Fade_Top" alt=""><div class="topicContainer"><div 
class="topic" xmlns="http://www.w3.org/1999/xhtml"><h1 class="title">Deploying
 a Visual Studio Tools for the Office System 3.0 Solution for the 2007 
Microsoft Office System Using Windows Installer (Part 2 of 2)</h1><div 
class="lw_vs"><div id="curversion"><strong>
            Office 2007</strong></div></div><div id="mainSection"><div 
id="mainBody"><p><strong>Summary:</strong> Learn how to deploy a 
Microsoft Visual Studio Tools for the Office system 3.0 add-in or 
document-level solution using a Visual Studio 2008 setup project to 
create a Windows Installer package that targets the 2007 Microsoft 
Office system. (12 printed pages)</p><p>Wouter van Vugt, Code Counsel</p><p>Ted
 Pattison, Ted Pattison Group</p><p><strong>Applies to:</strong>  
Microsoft Visual Studio Tools for the Microsoft Office system 3.0, 2007 
Microsoft Office system, Visual Studio 2008</p><p><strong>Download:</strong><span
 class="unresolvedLink">http://code.msdn.microsoft.com/VSTO3MSI</span></p><ul><li
 class="unordered"><strong>Contents</strong><br><br></li><li 
class="unordered"><a href="#VSTO3Solutions2_Overview">Overview</a><br><br></li><li
 class="unordered"><a 
href="#VSTO3Solutions2_DownloadSamplesProvidedwiththisArticle">Download 
Samples Provided with this Article</a><br><br></li><li class="unordered"><a
 href="#VSTO3Solutions2_HandlingTrustasPartoftheInstallation">Handling 
Trust as Part of the Installation</a><br><br></li><li class="unordered"><a
 href="#VSTO3Solutions2_DeployingAdditionalComponents">Deploying 
Additional Components</a><br><br></li><li class="unordered"><a 
href="#VSTO3Solutions2_AdditionalRequirementsforDocumentlevelSolutions">Additional
 Requirements for Document-level Solutions</a><br><br></li><li 
class="unordered"><a 
href="#VSTO3Solutions2_DeployingtotheClickOnceCache">Deploying to the 
ClickOnce Cache</a><br><br></li><li class="unordered"><a 
href="#VSTO3Solutions2_AdaptingtheSetupProjectforWindowsVista">Adapting 
the Setup Project for Windows Vista</a><br><br></li><li 
class="unordered"><a href="#VSTO3Solutions2_KnownIssues">Known Issues</a><br><br></li><li
 class="unordered"><a href="#VSTO3Solutions2_AdditionalResources">Additional
 Resources</a><br><br></li><li class="unordered"><a 
href="#VSTO3Solutions2_AbouttheAuthors">About the Authors</a><br><br></li></ul><a
 id="VSTO3Solutions2_Overview"></a><h1 class="heading">Overview</h1><div
 id="sectionSection0" class="section"><p>This article, the second of 
two, provides three additional walkthroughs that show how to deploy a 
Visual Studio Tools for Office solution using a Visual Studio 2008 
Windows Installer package. These walkthroughs only apply to solutions 
developed for the 2007 Microsoft Office system and the VSTO 3.0 runtime.</p><div
 class="alert"><table><tbody><tr><th><img id="note" 
alt="Cc616991.note(en-us,office.12).gif" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"
 title="Cc616991.note(en-us,office.12).gif" xmlns="" class="cl_IC101471"><strong>Note:
 </strong></th></tr><tr><td>
These walkthroughs do not apply to projects in Visual Studio 2008 that 
are based on applications in Microsoft Office 2003, which use the code 
access security policy for granting trust to solutions.<p></p></td></tr></tbody></table><p></p></div><p>The
 first walkthrough <a 
href="#VSTO3SolutionPart2_HandlingTrustasPartoftheInstallation">Handling
 Trust as Part of the Installation</a> provides steps to grant trust to 
your Office solutions by using either a known and trusted certificate or
 an inclusion list entry. The second walkthrough <a 
href="#VSTO3SolutionPart2_DeployingtotheClickOnceCache">Deploying to the
 ClickOnce Cache</a> provides steps to deploy additional assemblies with
 your Office solution. Finally, the third walkthrough <a 
href="#VSTO3SolutionPart2_AdditionalRequirementsforDocumentlevelSolutions">Additional
 Requirements for Document-level Solutions</a> demonstrates how to 
deploy the document and assembly in separate locations. The instructions
 only apply to Office solutions created for the VSTO 3.0 runtime and the
 2007 Microsoft Office system.</p><p>Important: Before you start these 
walkthroughs, read and follow the instructions in <a 
href="http://msdn.microsoft.com/en-us/library/cc563937%28v=office.12%29.aspx">Deploying
 a Visual Studio Tools for the Office System 3.0 Solution for the 2007 
Microsoft Office System Using Windows Installer (Part 1 of 2)</a>.</p></div><a
 id="VSTO3Solutions2_DownloadSamplesProvidedwiththisArticle"></a><h1 
class="heading">Download Samples Provided with this Article</h1><div 
id="sectionSection1" class="section"><p>The walkthroughs provided in 
this article use various sample files contained in the download. The 
download contains the source code for the following components:</p><ul><li
 class="unordered">
All sample projects created in this article.<br><br></li><li 
class="unordered">
Bootstrapper configuration files for the Redistributable Primary Interop
 Assemblies for the 2007 Microsoft Office system.<br><br></li><li 
class="unordered">
Custom action classes for the Setup projects used to deploy the Visual 
Studio Tools for Office solution.<br><br></li></ul><p>By default, these 
files are installed into the following folder:</p><p><code>%ProgramFiles%\Microsoft
 Visual Studio Tools for the Office system 3.0 Resources\Windows 
Installer Sample\</code></p><p>This article refers to this installation 
folder as {SamplesDir}.</p><p><strong>Download:</strong><span 
class="unresolvedLink">http://code.msdn.microsoft.com/VSTO3MSI</span></p></div><a
 id="VSTO3Solutions2_HandlingTrustasPartoftheInstallation"></a><h1 
class="heading">Handling Trust as Part of the Installation</h1><div 
id="sectionSection2" class="section"><p>You can use two options to trust
 the solution during the installation process. First, you can sign the 
application and deployment manifests using a certificate trusted by the 
user. Second, you can add the location of the deployment manifest and 
the certificate that you used to sign the manifests to the list of 
trusted solutions. </p><p>The preferred solution to handling security is
 to sign the manifests using a known and trusted publisher’s 
certificate. You should request a certificate from a certificate 
authority trusted by both you and the user. For more information about 
how to obtain a certificate for signing, see <a 
href="http://msdn.microsoft.com/en-us/library/ms172240.aspx">ClickOnce 
Deployment and Authenticode</a>. After a real certificate is obtained, 
the certificate must be explicitly trusted by adding it to the <strong>Trusted
 Publishers</strong> list. For more information, see <a 
href="http://msdn.microsoft.com/en-us/library/ms172241.aspx">How to: Add
 a Trusted Publisher to a Client Computer for ClickOnce Applications</a>.</p>


To change the certificate used to sign the manifests
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
right-click <strong>ExcelAddIn</strong> and click <strong>Properties</strong>
 to show the properties of the <strong>ExcelAddIn</strong> project.</p></li><li><p>In
 the <strong>ExcelAddIn</strong> property pages, select the <strong>Signing</strong>
 tab. </p></li><li><p>On the <strong>Signing</strong> tab, ensure that <strong>Sign
 the ClickOnce</strong> manifest is checked. Click either <strong>Select
 from Store</strong> or <strong>Select from File</strong> to select the 
certificate you want to sign the deployment manifest. Make sure that you
 choose a certificate that is trusted by the user.</p></li><li><p>Compile
 and deploy the <strong>ExcelAddInSetup</strong> project.</p><div 
class="alert"><table><tbody><tr><th><img id="note" 
alt="Cc616991.note(en-us,office.12).gif" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"
 title="Cc616991.note(en-us,office.12).gif" xmlns="" class="cl_IC101471"><strong>Note:
 </strong></th></tr><tr><td>
Signing the ClickOnce manifest is different from signing an assembly 
using a strong-name. Strong-naming provides a mechanism for identifying 
and versioning .NET assemblies. Signing with a certificate assures users
 that they know where the code came from and verifies that the code has 
not been tampered with since its publication.<p></p></td></tr></tbody></table><p></p></div></li></ol><p>You
 can use the inclusion list API provided by Visual Studio Tools for 
Office to trust the add-in during the installation process. Using this 
API, you define a trust relationship based on the location of the 
deployment manifest and the public key of the certificate used to sign 
the manifest. You can use a custom action to call into this API during 
the installation process. </p><p>The download accompanying this article 
contains a Visual Studio 2008 solution with all custom actions used in 
the procedure. The custom action uses the <strong>UserInclusionList</strong>
 class to create the trust relationship for the add-in.</p>


To add the custom action project to your Visual Studio solution
<ol class="ordered"><li><p>In the <strong>Windows Explorer</strong>, 
navigate to the <strong>{SamplesDir}\projects</strong> folder. Copy the 
language specific <strong>InclusionListCustomActions</strong> folder to 
the root folder of your add-in. </p></li><li><p>In the <strong>Solution 
Explorer</strong>, right-click the <strong>Solution VSTO v3 Deployment 
Demo</strong> solution, expand <strong>Add</strong> and click <strong>Existing</strong><strong>Project</strong>.
 Navigate to the folder inside the solution root directory containing 
the <strong>InclusionListCustomActions</strong> project, select either <strong>InclusionListCustomActions.vbproj</strong>
 or <strong>InclusionListCustomActions.csproj</strong> depending on your
 language choice and click <strong>Open</strong> to add the project to 
the solution.</p><br><br><strong>Figure 23. Inclusion List Custom 
Actions</strong><br><br><img id="e14a4139-d1e8-4c21-b751-6f43e2dd7b48" 
alt="Inclusion List Custom Actions" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC81047.jpg"
 title="Inclusion List Custom Actions" xmlns=""></li></ol><p>The public 
key of the certificate used to sign the deployment manifest is necessary
 for the inclusion list API to validate that the solution is trusted. 
You must add the public key as part of a custom action.</p>


To retrieve the public key of the deployment manifest signature
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
select the <strong>ExcelAddIn</strong> project. </p></li><li><p>In the <strong>Solution
 Explorer toolbar</strong>, click <strong>Show All Files</strong> to 
show the files that are not part of the project but reside in the 
project directory.</p></li><li><p>Expand <strong>ExcelAddIn</strong>, 
next expand bin and finally expand release. </p></li><li><p>Right-click 
the <strong>ExcelAddIn.vsto</strong> file, and click <strong>Open</strong>
 to open a file editor for the deployment manifest.</p></li><li><p>Inside
 the <strong>ExcelAddIn.vsto</strong> editor, locate the <strong>Signature</strong>
 element that has an <strong>ID</strong> with the value <strong>StrongNameSignature</strong>.</p><br><br><strong>Figure
 24. &lt;RSAKeyValue&gt; element</strong><br><br><img 
id="35b67e24-6700-4117-8e7b-9a3544147339" alt="&lt;RSAKeyValue&gt; 
element" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC166935.jpg"
 title="&lt;RSAKeyValue&gt; element" xmlns=""></li><li><p>Inside the <strong>Signature</strong>
 element, locate the <strong>KeyInfo</strong> element that has an <strong>ID</strong>
 with the value <strong>StrongNameKeyInfo</strong>. Copy the entire 
contents of the <strong>KeyValue</strong> child element to a temporary 
location such as Notepad. Do not copy the <strong>KeyValue</strong> 
element itself, only the content. Remove the newline characters from the
 string. The following sample shows the final result. Note that the text
 is wrapped.</p><div class="LW_CodeSnippetContainer" xmlns=""><a 
name="CodeSpippet0"></a><div 
class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode0');">Copy</a></div></div><div
 id="CodeSnippetContainerCode0" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre>&lt;RSAKeyValue&gt;&lt;Modulus&gt;0VjTVM/DV60EG+n1FvletQlhgsvxny0FrqqApTHfr+Tjvokfpftqg3f30NF0J+HwLHeCJsoGMvKtVntRbvO0j/iriBivPIMXIBjZoea/OT+TlBvS1kH3w3H+TmIcQosQ1Nf1J7gfO3X6WGHBu8GhWb2llJJ3sK+s6xIIUgQzzh0=&lt;/Modulus&gt;&lt;Exponent&gt;AQAB&lt;/Exponent&gt;&lt;/RSAKeyValue&gt;
</pre></div></div></div></div></li></ol><p>The inclusion list API 
requires two pieces of information: the location of the deployment 
manifest and the public key of the certificate you used to sign the 
manifest. These values are used to verify the integrity of the 
deployment manifest. The public key is hardcoded in the custom action 
class.</p>


To configure the custom action
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
expand <strong>InclusionListCustomActions</strong>. Right-click <strong>TrustInstaller.vb</strong>
 or <strong>TrustInstaller.cs</strong>, and click <strong>View</strong><strong>Code</strong>
 to edit the code of the custom action class.</p></li><li><p>In the <strong>TrustInstaller</strong>
 code editor, locate the <strong>RSA_PublicKey</strong> constant inside 
the <strong>TrustInstaller</strong> class. </p></li><li><p>Change the 
value of the <strong>RSA_PublicKey</strong> constant to the value copied
 from the deployment manifest in the previous step. Make sure that there
 are no newline characters in the value.</p><div 
class="LW_CodeSnippetContainer" xmlns=""><a name="CodeSpippet1"></a><div
 class="LW_CodeSnippetContainerTabs"><div 
class="LW_CodeSnippetContainerTabLeft"><img 
class="cl_lw_codesnippet_lt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div><div
 class="LW_CodeSnippetContainerTabFirst"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20Basic');" 
class="LW_CodeSnippetContainerTabLinkBold">VB</a></div><div 
class="LW_CodeSnippetContainerTabActive"><a 
class="LW_CodeSnippetContainerTabLinkNormal">C#</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20C++');" 
class="LW_CodeSnippetContainerTabLinkNormal">C++</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('F#');" 
class="LW_CodeSnippetContainerTabLinkNormal">F#</a></div><div 
class="LW_CodeSnippetContainerTabLast"><a 
href="javascript:%20CodeSnippet_SetLanguage('JScript');" 
class="LW_CodeSnippetContainerTabLinkNormal">JScript</a></div><div 
class="LW_CodeSnippetContainerTabRight"><img 
class="cl_lw_codesnippet_rt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div></div><div
 class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode1');">Copy</a></div></div><div
 id="CodeSnippetContainerCode1" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre>This language is not supported or no code example is available.
</pre></div></div></div></div><p></p><div 
class="LW_CodeSnippetContainer" xmlns=""><a name="CodeSpippet2"></a><div
 class="LW_CodeSnippetContainerTabs"><div 
class="LW_CodeSnippetContainerTabLeft"><img 
class="cl_lw_codesnippet_lt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div><div
 class="LW_CodeSnippetContainerTabFirst"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20Basic');" 
class="LW_CodeSnippetContainerTabLinkNormal">VB</a></div><div 
class="LW_CodeSnippetContainerTabActive"><a 
class="LW_CodeSnippetContainerTabLinkBold">C#</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20C++');" 
class="LW_CodeSnippetContainerTabLinkNormal">C++</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('F#');" 
class="LW_CodeSnippetContainerTabLinkNormal">F#</a></div><div 
class="LW_CodeSnippetContainerTabLast"><a 
href="javascript:%20CodeSnippet_SetLanguage('JScript');" 
class="LW_CodeSnippetContainerTabLinkNormal">JScript</a></div><div 
class="LW_CodeSnippetContainerTabRight"><img 
class="cl_lw_codesnippet_rt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div></div><div
 class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode2');">Copy</a></div></div><div
 id="CodeSnippetContainerCode2" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre>[RunInstaller(<span style="color: Blue;">true</span>)]
<span style="color: Blue;">public</span> <span style="color: Blue;">class</span> TrustInstaller
    : Installer
{
    <span style="color: Blue;">const</span> <span style="color: Blue;">string</span> RSA_PublicKey = <span style="color: rgb(163, 21, 21);">"&lt;RSAKeyValue&gt;..&lt;/RSAKeyValue&gt;"</span>;
    ..}
</pre></div></div></div></div></li></ol><p>You need to add the custom 
action assembly to the setup project. This involves a similar step as 
including the primary add-in assembly. </p>


To add the custom action to the setup project
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
right-click <strong>ExcelAddInSetup</strong>, click <strong>Add</strong>
 and then <strong>Project</strong><strong>Output</strong>.</p></li><li><p>In
 the <strong>Add Project Output Group</strong> dialog box, select the <strong>InclusionListCustomActions</strong>
 project and the <strong>Primary</strong><strong>Output</strong> option.
 </p></li><li><p>Click <strong>OK</strong> to close the dialog box. </p><br><br><strong>Figure
 25. Inclusion List Custom Action - Add Project Output Group</strong><br><br><img
 id="b2339290-758e-4043-ade7-94190ec5f8c0" alt="Inclusion List Custom 
Action" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC77795.jpg"
 title="Inclusion List Custom Action" xmlns=""></li><li><p>In the <strong>Solution
 Explorer</strong>, right-click <strong>ExcelAddInSetup</strong>. Expand
 <strong>View</strong> and click <strong>Custom</strong><strong>Actions</strong>
 to view the custom action editor for <strong>ExcelAddInSetup</strong>.</p></li><li><p>In
 the <strong>Custom</strong><strong>Actions (ExcelAddInSetup)</strong> 
editor, right-click <strong>Custom</strong><strong>Actions</strong> and 
click <strong>Add</strong><strong>Custom</strong><strong>Action</strong>.</p></li><li><p>In
 the <strong>Select Item in Project</strong> dialog box, in the <strong>Look
 in</strong> list, select <strong>Application Folder</strong>. </p></li><li><p>Select
 <strong>Primary Output from InclusionListCustomActions(active)</strong>
 and click <strong>OK</strong> to register the custom actions contained 
in the <strong>InclusionListCustomActions</strong> assembly for 
execution during installation of the Windows Installer package. </p></li><li><p>Right-click
 <strong>Primary Output from InclusionListCustomActions(Active)</strong>
 under the <strong>Install</strong> node and click <strong>Rename</strong>.
 Change the name of the custom action under the Install node to <strong>Add
 add-in to inclusion list</strong>.</p></li><li><p>Change the name of 
the custom action under the Uninstall node to <strong>Remove add-in from
 inclusion list</strong>.</p><br><br><strong>Figure 26. ExcelAddInSetup 
Custom Actions</strong><br><br><img 
id="335bfc60-0b97-4c24-aa02-248a7e54f034" alt="ExcelAddInSetup Custom 
Actions" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC152665.jpg"
 title="ExcelAddInSetup Custom Actions" xmlns=""><div class="alert"><table><tbody><tr><th><img
 id="note" alt="Cc616991.note(en-us,office.12).gif" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"
 title="Cc616991.note(en-us,office.12).gif" xmlns="" class="cl_IC101471"><strong>Note:
 </strong></th></tr><tr><td>
 It is important to add your custom action to all the four installation 
phases to allow the custom action environment to function properly, even
 though your custom action performs no task for certain phases.<p></p></td></tr></tbody></table><p></p></div></li><li><p>Right-click
 the <strong>Add add-in to inclusion list</strong> custom action and 
click <strong>Properties Window</strong>. </p></li><li><p>In the <strong>Properties</strong>
 window, set the value of the <strong>CustomActionData</strong> property
 to <strong>/deploymentManifestLocation="[TARGETDIR]ExcelAddIn.vsto"</strong>.</p><br><br><strong>Figure
 27. Inclusion List Custom Action Properties</strong><br><br><img 
id="526d08f7-6906-4e0c-b25c-f381861b5085" alt="Inclusion List Custom 
Action Properties" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC147185.jpg"
 title="Inclusion List Custom Action Properties" xmlns=""></li></ol><p>Referencing
 the <strong>InclusionListCustomActions</strong> project includes all 
the components that the custom action depends on. Exclude these 
components from the setup project.</p>


To exclude the InclusionListCustomActions project dependencies
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
expand <strong>ExcelAddInSetup</strong> and then expand <strong>Detected</strong><strong>Dependencies</strong>.</p></li><li><p>Select
 <strong>Microsoft.VisualStudio.Tools.Applications.Hosting.v9.0.dll</strong>
 and <strong>Microsoft.VisualStudio.Tools.Office.Runtime.v9.0.dll</strong>.
 Right-click the selection and click <strong>Properties</strong>. </p></li><li><p>In
 the <strong>Properties</strong> window, change the <strong>Exclude</strong>
 property to <strong>True</strong> to exclude the dependent assemblies 
from the setup project. </p><br><br><strong>Figure 28. Excluding 
Dependencies</strong><br><br><img 
id="d1c73c3f-7a4d-4213-b219-dc5b458a565a" alt="Excluding Dependencies" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC51007.jpg"
 title="Excluding Dependencies" xmlns=""></li></ol><p>The setup project 
is not compiled as part of a general solution compilation because the 
build can take a long time on larger projects. You need to manually 
compile the setup project and copy the resulting files to a location 
that is accessible to the user.</p>


To build the setup project
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
right-click the <strong>ExcelAddInSetup</strong> project and click <strong>Build</strong>.
 </p></li><li><p>Using <strong>Windows</strong><strong>Explorer</strong>,
 navigate to the output directory of the <strong>ExcelAddInSetup</strong>
 project found in the VSTO v3 Deployment Demo\ExcelAddInSetup\Release 
folder. Copy all files to a location that users can access like a 
network share, CD, or USB stick.</p></li></ol></div><a 
id="VSTO3Solutions2_DeployingAdditionalComponents"></a><h1 
class="heading">Deploying Additional Components</h1><div 
id="sectionSection3" class="section"><p>While a simple add-in consists 
of only the primary assembly and the manifest files, a real-world add-in
 will most likely use separate assemblies that form the parts of the 
add-in as well as resources such as configuration files on disk. In this
 section, you will learn how to deploy these additional files with the 
Visual Studio 2008 Setup Project.</p><p>In this following procedure, the
 message box display is performed by a helper assembly instead of the 
add-in assembly. </p>


To add a helper assembly and add a reference
<ol class="ordered"><li><p>On the <strong>File</strong> menu, expand <strong>Add</strong>
 and click <strong>New Project</strong> to add a new project to the VSTO
 v3 Deployment Demo solution.</p></li><li><p>In the <strong>Add New 
Project</strong> dialog box, in the <strong>Project types</strong> pane,
 select <strong>Visual C# </strong>or <strong>Visual Basic</strong> 
depending on your language preference. </p></li><li><p>In the <strong>Templates</strong>
 pane, select <strong>Class Library</strong> from the <strong>Visual 
Studio installed templates</strong> group.</p></li><li><p>In the <strong>Name</strong>
 dialog box, type <strong>ExcelAddInLibrary</strong>.</p></li><li><p>Ensure
 that the folder identified by the <strong>Location</strong> box is 
inside the VSTO v3 Deployment Demo folder created for the solution,</p></li><li><p>Click
 <strong>OK</strong> to create the new class library. Visual Studio 
opens the code editor for the <strong>Class1.vb</strong> or <strong>Class1.cs</strong>
 file.</p><br><br><strong>Figure 29. Solution Explorer - 
ExcelAddInLibrary</strong><br><br><img 
id="8fad9977-f990-48e9-8a5e-bd3ba6359a6a" alt="Excel Addin in Solution 
Explorer" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC92339.jpg"
 title="Excel Addin in Solution Explorer" xmlns=""><p>The helper 
assembly shows the message box instead of the main add-in assembly. You 
now need to add a reference the System.Windows.Forms assembly.</p></li><li><p>In
 the <strong>Solution Explorer</strong>, right-click <strong>ExcelAddInLibrary</strong>
 and click <strong>Add Reference</strong>. </p></li><li><p>In the <strong>Add
 Reference</strong> dialog box, on the <strong>.NET</strong> tab, select
 <strong>System.Windows.Forms</strong> and click <strong>OK</strong>.</p></li></ol>


To add code to the helper assembly
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
right-click <strong>Class1.vb</strong> or <strong>Class1.cs</strong> and
 click <strong>Rename</strong>. </p></li><li><p>Rename the class <strong>Helper.vb</strong>
 or <strong>Helper.cs</strong>. </p></li><li><p>Click <strong>OK</strong>
 to rename the actual class defined in the file.</p></li><li><p>If the 
Helper code file is not currently open, in the <strong>Solution Explorer</strong>,
 right-click the <strong>Helper.vb</strong> or <strong>Helper.cs</strong>
 file, and click <strong>View</strong><strong>code</strong> to open the 
code file.</p></li><li><p>In the code editor, locate the <strong>Helper</strong>
 class. Add a shared (or static) method called <strong>ShowMessage</strong>.
 This method should take one parameter of type <strong>string</strong> 
with the name <strong>message</strong>.</p></li><li><p>In the <strong>ShowMessage</strong>
 method, add a call to <strong>System.Windows.MessageBox.Show</strong>. 
Pass in the parameter received in the ShowMessage method.</p><div 
class="LW_CodeSnippetContainer" xmlns=""><a name="CodeSpippet3"></a><div
 class="LW_CodeSnippetContainerTabs"><div 
class="LW_CodeSnippetContainerTabLeft"><img 
class="cl_lw_codesnippet_lt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div><div
 class="LW_CodeSnippetContainerTabFirst"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20Basic');" 
class="LW_CodeSnippetContainerTabLinkBold">VB</a></div><div 
class="LW_CodeSnippetContainerTabActive"><a 
class="LW_CodeSnippetContainerTabLinkNormal">C#</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20C++');" 
class="LW_CodeSnippetContainerTabLinkNormal">C++</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('F#');" 
class="LW_CodeSnippetContainerTabLinkNormal">F#</a></div><div 
class="LW_CodeSnippetContainerTabLast"><a 
href="javascript:%20CodeSnippet_SetLanguage('JScript');" 
class="LW_CodeSnippetContainerTabLinkNormal">JScript</a></div><div 
class="LW_CodeSnippetContainerTabRight"><img 
class="cl_lw_codesnippet_rt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div></div><div
 class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode3');">Copy</a></div></div><div
 id="CodeSnippetContainerCode3" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre>This language is not supported or no code example is available.
</pre></div></div></div></div><p></p><div 
class="LW_CodeSnippetContainer" xmlns=""><a name="CodeSpippet4"></a><div
 class="LW_CodeSnippetContainerTabs"><div 
class="LW_CodeSnippetContainerTabLeft"><img 
class="cl_lw_codesnippet_lt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div><div
 class="LW_CodeSnippetContainerTabFirst"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20Basic');" 
class="LW_CodeSnippetContainerTabLinkNormal">VB</a></div><div 
class="LW_CodeSnippetContainerTabActive"><a 
class="LW_CodeSnippetContainerTabLinkBold">C#</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20C++');" 
class="LW_CodeSnippetContainerTabLinkNormal">C++</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('F#');" 
class="LW_CodeSnippetContainerTabLinkNormal">F#</a></div><div 
class="LW_CodeSnippetContainerTabLast"><a 
href="javascript:%20CodeSnippet_SetLanguage('JScript');" 
class="LW_CodeSnippetContainerTabLinkNormal">JScript</a></div><div 
class="LW_CodeSnippetContainerTabRight"><img 
class="cl_lw_codesnippet_rt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div></div><div
 class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode4');">Copy</a></div></div><div
 id="CodeSnippetContainerCode4" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre><span style="color: Blue;">public</span> <span style="color: Blue;">class</span> Helper
{
    <span style="color: Blue;">public</span> <span style="color: Blue;">static</span> <span style="color: Blue;">void</span> ShowMessage(
        <span style="color: Blue;">string</span> message)
    {
        System.Windows.Forms.MessageBox.Show(message);
    }
}
</pre></div></div></div></div></li></ol><p>Configure the message that is
 displayed by the helper assembly by using a .NET configuration file.</p>


To add a configuration file
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
right-click <strong>ExcelAddIn</strong>, expand <strong>Add</strong> and
 then click <strong>New Item</strong>. </p></li><li><p>When using Visual
 Basic, in <strong>the Add New Item – ExcelAddIn</strong> dialog box, in
 the <strong>Categories</strong> pane, select <strong>General</strong>.</p></li><li><p>In
 the <strong>Templates</strong> pane, select <strong>Application 
Configuration File</strong> and click <strong>Add</strong> to add the 
configuration file to the <strong>ExcelAddIn</strong> project. The 
configuration file is automatically opened by Visual Studio.</p></li><li><p>In
 the <strong>app.config</strong> file editor, within the <strong>configuration</strong>
 element, add the <strong>appSettings</strong> element. </p></li><li><p>Within
 the <strong>appSettings</strong> element, create a new <strong>add</strong>
 element. Add two attributes to this element named <strong>key</strong> 
and <strong>value</strong>. Set <strong>message</strong> as the value 
for the <strong>key</strong> attribute, and <strong>hello world</strong>
 for the value attribute.</p><div class="LW_CodeSnippetContainer" 
xmlns=""><a name="CodeSpippet5"></a><div 
class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode5');">Copy</a></div></div><div
 id="CodeSnippetContainerCode5" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;
  &lt;appSettings&gt;
    &lt;add key="message" value="Hello World"/&gt;
  &lt;/appSettings&gt;
&lt;/configuration&gt;

</pre></div></div></div></div></li></ol><p>To use the helper assembly, 
add a reference from the add-in. After the assembly is referenced, the 
add-in can read the message from the configuration file and call the 
helper assembly with that message.</p>


To reference the helper assembly
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
right-click <strong>ExcelAddIn</strong> and click <strong>Add</strong><strong>Reference</strong>.
 </p></li><li><p>In the <strong>Add Reference</strong> dialog box, on 
the <strong>Projects</strong> tab, select <strong>ExcelAddInLibrary</strong>
 and click <strong>OK</strong> to add the reference to the 
ExcelAddInLibrary assembly.</p></li><li><p>Perform a similar step to add
 a reference to <strong>System.Configuration</strong>, which is located 
on the <strong>.NET</strong> tab of the <strong>Add Reference</strong> 
dialog box.</p></li></ol>


To call the helper assembly from the add-in
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
expand <strong>ExcelAddIn</strong> and then <strong>Excel</strong>. 
Right-click <strong>ThisAddIn.vb</strong> or <strong>ThisAddIn.cs</strong>
 and click <strong>View Code</strong>.</p></li><li><p>Add using 
statements for the <strong>System.Configuration</strong> and <strong>ExcelAddInLibrary</strong>
 namespaces.</p><div class="LW_CodeSnippetContainer" xmlns=""><a 
name="CodeSpippet6"></a><div class="LW_CodeSnippetContainerTabs"><div 
class="LW_CodeSnippetContainerTabLeft"><img 
class="cl_lw_codesnippet_lt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div><div
 class="LW_CodeSnippetContainerTabFirst"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20Basic');" 
class="LW_CodeSnippetContainerTabLinkBold">VB</a></div><div 
class="LW_CodeSnippetContainerTabActive"><a 
class="LW_CodeSnippetContainerTabLinkNormal">C#</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20C++');" 
class="LW_CodeSnippetContainerTabLinkNormal">C++</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('F#');" 
class="LW_CodeSnippetContainerTabLinkNormal">F#</a></div><div 
class="LW_CodeSnippetContainerTabLast"><a 
href="javascript:%20CodeSnippet_SetLanguage('JScript');" 
class="LW_CodeSnippetContainerTabLinkNormal">JScript</a></div><div 
class="LW_CodeSnippetContainerTabRight"><img 
class="cl_lw_codesnippet_rt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div></div><div
 class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode6');">Copy</a></div></div><div
 id="CodeSnippetContainerCode6" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre>This language is not supported or no code example is available.
</pre></div></div></div></div><p></p><div 
class="LW_CodeSnippetContainer" xmlns=""><a name="CodeSpippet7"></a><div
 class="LW_CodeSnippetContainerTabs"><div 
class="LW_CodeSnippetContainerTabLeft"><img 
class="cl_lw_codesnippet_lt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div><div
 class="LW_CodeSnippetContainerTabFirst"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20Basic');" 
class="LW_CodeSnippetContainerTabLinkNormal">VB</a></div><div 
class="LW_CodeSnippetContainerTabActive"><a 
class="LW_CodeSnippetContainerTabLinkBold">C#</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20C++');" 
class="LW_CodeSnippetContainerTabLinkNormal">C++</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('F#');" 
class="LW_CodeSnippetContainerTabLinkNormal">F#</a></div><div 
class="LW_CodeSnippetContainerTabLast"><a 
href="javascript:%20CodeSnippet_SetLanguage('JScript');" 
class="LW_CodeSnippetContainerTabLinkNormal">JScript</a></div><div 
class="LW_CodeSnippetContainerTabRight"><img 
class="cl_lw_codesnippet_rt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div></div><div
 class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode7');">Copy</a></div></div><div
 id="CodeSnippetContainerCode7" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre><span style="color: Blue;">using</span> System.Configuration;
<span style="color: Blue;">using</span> ExcelAddInLibrary;

</pre></div></div></div></div></li><li><p>Locate the <strong>ThisAddIn_StartUp</strong>
 method, where the call to MessageBox.Show was added earlier.</p></li><li><p>Replace
 the body of the <strong>ThisAddIn_StartUp</strong> method with the 
following block of code. The code reads the message from the 
configuration file and calls the Helper class with that message.</p><div
 class="LW_CodeSnippetContainer" xmlns=""><a name="CodeSpippet8"></a><div
 class="LW_CodeSnippetContainerTabs"><div 
class="LW_CodeSnippetContainerTabLeft"><img 
class="cl_lw_codesnippet_lt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div><div
 class="LW_CodeSnippetContainerTabFirst"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20Basic');" 
class="LW_CodeSnippetContainerTabLinkBold">VB</a></div><div 
class="LW_CodeSnippetContainerTabActive"><a 
class="LW_CodeSnippetContainerTabLinkNormal">C#</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20C++');" 
class="LW_CodeSnippetContainerTabLinkNormal">C++</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('F#');" 
class="LW_CodeSnippetContainerTabLinkNormal">F#</a></div><div 
class="LW_CodeSnippetContainerTabLast"><a 
href="javascript:%20CodeSnippet_SetLanguage('JScript');" 
class="LW_CodeSnippetContainerTabLinkNormal">JScript</a></div><div 
class="LW_CodeSnippetContainerTabRight"><img 
class="cl_lw_codesnippet_rt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div></div><div
 class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode8');">Copy</a></div></div><div
 id="CodeSnippetContainerCode8" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre>This language is not supported or no code example is available.
</pre></div></div></div></div><p></p><div 
class="LW_CodeSnippetContainer" xmlns=""><a name="CodeSpippet9"></a><div
 class="LW_CodeSnippetContainerTabs"><div 
class="LW_CodeSnippetContainerTabLeft"><img 
class="cl_lw_codesnippet_lt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div><div
 class="LW_CodeSnippetContainerTabFirst"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20Basic');" 
class="LW_CodeSnippetContainerTabLinkNormal">VB</a></div><div 
class="LW_CodeSnippetContainerTabActive"><a 
class="LW_CodeSnippetContainerTabLinkBold">C#</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20C++');" 
class="LW_CodeSnippetContainerTabLinkNormal">C++</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('F#');" 
class="LW_CodeSnippetContainerTabLinkNormal">F#</a></div><div 
class="LW_CodeSnippetContainerTabLast"><a 
href="javascript:%20CodeSnippet_SetLanguage('JScript');" 
class="LW_CodeSnippetContainerTabLinkNormal">JScript</a></div><div 
class="LW_CodeSnippetContainerTabRight"><img 
class="cl_lw_codesnippet_rt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div></div><div
 class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode9');">Copy</a></div></div><div
 id="CodeSnippetContainerCode9" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre><span style="color: Blue;">private</span> <span style="color: Blue;">void</span> ThisAddIn_Startup(<span style="color: Blue;">object</span> sender, System.EventArgs e)
{
    <span style="color: Blue;">string</span> message = ConfigurationManager.AppSettings[<span style="color: rgb(163, 21, 21);">"message"</span>];
    Helper.ShowMessage(message);
}
</pre></div></div></div></div></li></ol>



To build the solution
<ul><li><p>To verify that everything is set up correctly, compile the 
solution. On the <strong>Build</strong> menu, click <strong>Build 
Solution</strong> to compile the modified add-in. Make sure that there 
are no compilation errors.</p></li></ul><p>Using the project reference 
that you have added earlier to the ExcelAddIn project, the 
ExcelAddInSetup can locate the helper assembly. The configuration file 
is tagged as a content file and is added to the setup project as such.</p>


To modify the setup project
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
expand <strong>ExcelAddInSetup</strong>. Right-click <strong>Detected</strong><strong>Dependencies</strong>
 and click <strong>Refresh Dependencies</strong>. This detects the 
reference from ExcelAddIn to ExcelAddInLibrary and automatically 
includes this helper assembly in the Windows Installer package.</p></li><li><p>In
 the <strong>Solution Explorer</strong>, right-click <strong>ExcelAddInSetup</strong>,
 click <strong>Add</strong> and then <strong>Project Output</strong>.</p></li><li><p>In
 the <strong>Add Project Output Group</strong> dialog box, confirm that 
the <strong>ExcelAddIn</strong> project is selected and select <strong>the
 Content Files</strong> option. </p></li><li><p>Click <strong>OK</strong>
 to close the dialog box. This adds the configuration file to the 
Windows Installer package.</p><p>You can now build the setup project and
 deploy it to the user computer using the steps described earlier in 
this article.</p></li></ol></div><a 
id="VSTO3Solutions2_AdditionalRequirementsforDocumentlevelSolutions"></a><h1
 class="heading">Additional Requirements for Document-level Solutions</h1><div
 id="sectionSection4" class="section"><p>Deploying document-level 
solutions require a few different configuration steps in the Windows 
Installer setup project. </p><p>Document-level solutions do not make use
 of the registry. Instead, the location of the deployment manifest is 
defined using custom document properties in the Microsoft Office file. 
By default, the location uses a relative path to the deployment 
manifest, meaning that if the document is installed into the same folder
 as the customization assembly you do not need to alter the manifest 
location contained within the document. However, if you intend to deploy
 the document to a different folder as the customization assembly, you 
need to update the document properties to a fully qualified path.</p><p>For
 more information about document properties used by Visual Studio Tools 
for Office, see <a 
href="http://msdn.microsoft.com/en-us/library/ds87aeyf.aspx">Custom 
Properties Overview</a></p><p>The setup project for document-level 
solutions requires the same steps as detailed in the walkthrough for a 
simple installer. However, you do not have to create the registry keys 
because the Office application does not use them to locate the 
customization for the document. The download accompanying this article 
provides a sample document-level solution named <strong>ExcelDocumentSolution</strong>.</p><p>The
 following list outlines the basic steps required for a document-level 
solution. Details on how to perform these tasks are found in the 
Creating a basic installer procedure in Part 1 of this article. </p><ul><li
 class="unordered">
Create the Visual Studio 2008 Setup Project.<br><br></li><li 
class="unordered">
Add the primary output of your document-level solution. The Microsoft 
Office document itself is also part of the primary output so you do not 
add it separately to the setup project.<br><br></li><li 
class="unordered">
Add the deployment and application manifests as loose files.<br><br></li><li
 class="unordered">
Exclude the dependent components from the installer package.<br><br></li><li
 class="unordered">
Configure prerequisite packages.<br><br></li><li class="unordered">
Configure launch conditions.<br><br></li><li class="unordered">
Build the setup project and copy the results to the deployment location.<br><br></li><li
 class="unordered">
Deploy the document-level solution on the user computer by executing the
 setup.<br><br></li></ul><h4 class="subHeading">Changing the Location of
 the Deployed Document</h4><div class="subSection"><p>Using Windows 
Installer gives you one major advantage: you can move the Microsoft 
Office document on the user computer to a suitable location such as the 
user’s My Documents folder. However, you also have to update the 
location of the deployment manifest inside the document. You can do this
 with a custom action during installation. </p><p>The following steps 
assume you have created a similar setup project for a document-level 
solution called ExcelDocumentSolution with a setup project called 
ExcelDocumentSolutionSetup. The document-level solution sample provided 
in the download accompanying this article is based on the Excel 2007 
Workbook template. The setup project has been configured according to 
the steps outlined in the Creating a basic installer walkthrough, except
 for the registry keys that are not used by document-level solutions. </p><p>The
 download accompanying this article contains a sample custom action you 
use to move the document to the <strong>My Documents</strong> folder and
 re-attach the customization. The custom action uses the <strong>ServerDocument</strong>
 class to re-attach the customization.</p>


To add the custom action project to your Visual Studio solution
<ol class="ordered"><li><p>In <strong>Windows Explorer</strong>, 
navigate to the <strong>{SamplesDir}\projects</strong> folder. </p></li><li><p>Copy
 the language-specific <strong>DocumentManifestCustomActions</strong> 
folder to the root folder of your document-level solution. </p></li><li><p>In
 the <strong>Solution Explorer</strong>, right-click the <strong>Solution
 VSTO v3 Deployment Demo</strong> solution</p></li><li><p>Expand <strong>Add</strong>
 and click <strong>Existing Project</strong>. </p></li><li><p>Navigate 
to the folder inside the solution root directory that contains the <strong>DocumentManifestCustomActions
 </strong>project.</p></li><li><p>Select <strong>DocumentManifestCustomActions.vbproj</strong>
 or <strong>DocumentManifestCustomActions.csproj.</strong></p></li><li><p>Click
 <strong>Open</strong> to add the project to the solution.</p><br><br><strong>Figure
 30. Solution Explorer - Document Manifest Custom Actions</strong><br><br><img
 id="1cd4c275-67ef-41a7-940d-202222bcef3b" alt="Solutions Explorer" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC41688.jpg"
 title="Solutions Explorer" xmlns=""></li></ol><p>The custom action 
requires the solution ID of your Visual Studio Tools for Office 
document-level solution. This value is retrieved from the Visual Studio 
2008 project file. To begin, compile the document-level solution to add 
the solution ID to this project file.</p>


To retrieve the solution ID
<ol class="ordered"><li><p>On the <strong>Build</strong> menu, click <strong>Build
 Solution</strong> to build the document-level solution and add the 
solution ID property to the project file.</p></li><li><p>In the <strong>Solution
 Explorer</strong>, right-click <strong>ExcelDocumentSolution</strong>.</p></li><li><p>Click
 <strong>Unload</strong><strong>Project</strong> to access the project 
file from inside Visual Studio.</p><br><br><strong>Figure 31. Unloading 
Excel Document Solution</strong><br><br><img 
id="a87b6292-7bbe-4eb6-8ead-dfe89d2f25d9" alt="Unloading Excel Document 
Solution" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC91474.jpg"
 title="Unloading Excel Document Solution" xmlns=""></li><li><p>In the <strong>Solution
 Explorer</strong>, right-click <strong>ExcelDocumentSolution</strong> 
and click <strong>Edit</strong><strong>ExcelDocumentSolution.vbproj</strong>
 or <strong>Edit ExcelDocumentSolution.csproj</strong>.</p></li><li><p>In
 the <strong>ExcelDocumentSolution</strong> editor, locate the <strong>SolutionID</strong>
 element inside the <strong>PropertyGroup</strong> element. </p></li><li><p>Copy
 the GUID value of this element to a temporary location such as the 
clipboard or notepad.</p><br><br><strong>Figure 32. Retrieving the 
SolutionID</strong><br><br><img 
id="fe07c1eb-387e-4cf8-9182-71cd82d96f38" alt="Retrieving the 
SolutionID" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC123202.jpg"
 title="Retrieving the SolutionID" xmlns=""></li><li><p>In the <strong>Solution
 Explorer</strong>, right-click <strong>ExcelDocumentSolution</strong> 
and click <strong>Reload Project</strong>. </p></li><li><p>Click <strong>Yes</strong>
 in the dialog box that appears to close the <strong>ExcelDocumentSolution</strong>
 editor.</p></li></ol><p>Add the solution ID to the custom action for 
the document-level solution. </p>


To configure the custom action
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
expand <strong>DocumentManifestCustomActions</strong>. </p></li><li><p>Right-click
 <strong>ChangeManifestInstaller.vb</strong> or <strong>ChangeManifestInstaller.cs</strong>.</p></li><li><p>Click
 <strong>View</strong> code to edit the code for the custom action.</p></li><li><p>In
 the <strong>ChangeManifestInstaller</strong> code editor, locate <strong>SolutionID</strong>
 field inside the <strong>ChangeManifestInstaller</strong> class. </p></li><li><p>Change
 the field to use the solution ID of the ExcelDocumentSolution.</p><div 
class="LW_CodeSnippetContainer" xmlns=""><a name="CodeSpippet10"></a><div
 class="LW_CodeSnippetContainerTabs"><div 
class="LW_CodeSnippetContainerTabLeft"><img 
class="cl_lw_codesnippet_lt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div><div
 class="LW_CodeSnippetContainerTabFirst"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20Basic');" 
class="LW_CodeSnippetContainerTabLinkBold">VB</a></div><div 
class="LW_CodeSnippetContainerTabActive"><a 
class="LW_CodeSnippetContainerTabLinkNormal">C#</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20C++');" 
class="LW_CodeSnippetContainerTabLinkNormal">C++</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('F#');" 
class="LW_CodeSnippetContainerTabLinkNormal">F#</a></div><div 
class="LW_CodeSnippetContainerTabLast"><a 
href="javascript:%20CodeSnippet_SetLanguage('JScript');" 
class="LW_CodeSnippetContainerTabLinkNormal">JScript</a></div><div 
class="LW_CodeSnippetContainerTabRight"><img 
class="cl_lw_codesnippet_rt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div></div><div
 class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode10');">Copy</a></div></div><div
 id="CodeSnippetContainerCode10" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre>This language is not supported or no code example is available.
</pre></div></div></div></div><p></p><div 
class="LW_CodeSnippetContainer" xmlns=""><a name="CodeSpippet11"></a><div
 class="LW_CodeSnippetContainerTabs"><div 
class="LW_CodeSnippetContainerTabLeft"><img 
class="cl_lw_codesnippet_lt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div><div
 class="LW_CodeSnippetContainerTabFirst"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20Basic');" 
class="LW_CodeSnippetContainerTabLinkNormal">VB</a></div><div 
class="LW_CodeSnippetContainerTabActive"><a 
class="LW_CodeSnippetContainerTabLinkBold">C#</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('Visual%20C++');" 
class="LW_CodeSnippetContainerTabLinkNormal">C++</a></div><div 
class="LW_CodeSnippetContainerTab"><a 
href="javascript:%20CodeSnippet_SetLanguage('F#');" 
class="LW_CodeSnippetContainerTabLinkNormal">F#</a></div><div 
class="LW_CodeSnippetContainerTabLast"><a 
href="javascript:%20CodeSnippet_SetLanguage('JScript');" 
class="LW_CodeSnippetContainerTabLinkNormal">JScript</a></div><div 
class="LW_CodeSnippetContainerTabRight"><img 
class="cl_lw_codesnippet_rt_tab" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"></div></div><div
 class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode11');">Copy</a></div></div><div
 id="CodeSnippetContainerCode11" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre>[RunInstaller(<span style="color: Blue;">true</span>)]
<span style="color: Blue;">public</span> <span style="color: Blue;">class</span> ChangeManifestInstaller
    : Installer
{
    <span style="color: Blue;">static</span> <span style="color: Blue;">readonly</span> Guid SolutionID =         <span style="color: Blue;">new</span> Guid(<span style="color: rgb(163, 21, 21);">"2d58cc4d-44a1-426a-b936-c483e6945be7"</span>);
}

</pre></div></div></div></div></li><li><p>On the <strong>File</strong> 
menu, click <strong>Save ChangeManifestInstaller.vb</strong> or <strong>Save</strong><strong>ChangeManifestInstaller.cs</strong>
 to save your changes to the custom action class.</p></li></ol><p>The 
last step is to configure the custom action for the <strong>Install</strong>
 and <strong>Uninstall</strong> steps of the Windows Installer package. 
The Install step copies the document to the <strong>My Documents</strong>
 folder and re-attaches the customization. To perform this task, you 
need to configure the custom action with additional data. The Uninstall 
step removes the document from the My Documents folder. This task does 
not require additional configuration data.</p>


To configure the setup project
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
right-click <strong>ExcelDocumentSolutionSetup</strong>, expand <strong>Add</strong>
 and click <strong>Project Output</strong>.</p></li><li><p>In the <strong>Add
 Project Output Group</strong> dialog box, in the <strong>Project</strong>
 list, click <strong>DocumentManifestCustomActions</strong>. </p></li><li><p>Select
 <strong>Primary Output</strong> and click <strong>OK</strong> to close 
the dialog box and add the assembly containing the custom action to the 
setup project. This copies the assembly to the installation folder 
chosen by the user and allows it to be called as part of the setup 
process.</p><br><br><strong>Figure 33. Document Manifest Custom Actions -
 Add Project Output Group</strong><br><br><img 
id="037e612f-e58e-4fba-afa4-6fca880d003e" alt="Document Manifest Custom 
Actions" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC151805.jpg"
 title="Document Manifest Custom Actions" xmlns=""></li><li><p>In the <strong>Solution
 Explorer</strong>, right-click <strong>ExcelDocumentSolutionSetup</strong>.</p></li><li><p>Expand
 <strong>View</strong> and click <strong>Custom Actions</strong>.</p></li><li><p>In
 the <strong>Custom Actions(ExcelDocumentSolutionSetup)</strong> editor,
 right-click <strong>Custom Actions</strong> and click <strong>Add 
Custom Action</strong>.</p></li><li><p>In the <strong>Select Item in 
Project</strong> dialog box, in the <strong>Look In</strong> list, click
 <strong>Application Folder</strong>. Select <strong>Primary Output from
 DocumentManifestCustomActions(active)</strong> and click <strong>OK</strong>
 to add the custom action to the Install step. </p></li><li><p>Under the
 <strong>Install</strong><strong>node</strong>, right-click <strong>Primary
 output from DocumentManifestCustomActions(Active)</strong> and click <strong>Rename</strong>.
 Name the custom action <strong>Copy document to My Documents</strong> 
and attach customization.</p></li><li><p>Under the <strong>Uninstall 
node</strong>, right-click <strong>Primary output from 
DocumentManifestCustomActions(Active)</strong> and click <strong>Rename</strong>.
 Name the custom action <strong>Remove document from My Documents folder</strong>.</p><br><br><strong>Figure
 34. Document Manifest Custom Actions</strong><br><br><img 
id="f918d8b4-76a4-4374-92e0-9ad55fe35748" alt="Document Manifest Custom 
Actions" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC6736.jpg"
 title="Document Manifest Custom Actions" xmlns=""></li><li><p>In the <strong>Custom
 Actions(ExcelDocumentSolutionSetup)</strong> editor, right-click <strong>Copy
 document to My Documents and attach customization</strong> and click <strong>Properties
 Window</strong>.</p></li><li><p>In the <strong>Properties</strong> 
window, for the <strong>CustomActionData</strong> property, enter the 
following values. This passes in the location of the customization DLL, 
the location of the deployment manifest and the location of the 
Microsoft Office document. Note that the following text has been 
wrapped. </p><div class="LW_CodeSnippetContainer" xmlns=""><a 
name="CodeSpippet12"></a><div 
class="LW_CodeSnippetContainerCodeCollection"><div 
class="LW_CodeSnippetToolBar"><div class="LW_CodeSnippetToolBarText" 
style=""><a title="Copy to clipboard." 
href="javascript:CodeSnippet_CopyCode('CodeSnippetContainerCode12');">Copy</a></div></div><div
 id="CodeSnippetContainerCode12" class="LW_CodeSnippetContainerCode"><div
 style="color: Black;"><pre>/assemblyLocation="[TARGETDIR]ExcelDocumentSolution.dll"/deploymentManifestLocation="[TARGETDIR]ExcelDocumentSolution.vsto"/documentLocation="[TARGETDIR]ExcelDocumentSolution.xlsx"
</pre></div></div></div></div><br><br><strong>Figure 35. Custom Action 
to Copy Document to My Documents</strong><br><br><img 
id="11356524-59ef-45bc-b5ba-b613551ad900" alt="Custom Action to Copy 
Document" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC35969.jpg"
 title="Custom Action to Copy Document" xmlns=""></li><li><p>Compile and
 deploy the <strong>ExcelDocumentSolutionSetup</strong> project.</p></li><li><p>Look
 in <strong>My Documents</strong> folder, and open the 
ExcelDocumentSolution.xlsx file.</p></li></ol></div></div><a 
id="VSTO3Solutions2_DeployingtotheClickOnceCache"></a><h1 
class="heading">Deploying to the ClickOnce Cache</h1><div 
id="sectionSection5" class="section"><p>As a hybrid approach you can 
combine the benefits of Windows Installer based deployment with the 
benefits of ClickOnce. To do this, create and configure a basic Windows 
Installer package that only installs prerequisite components, not the 
Visual Studio Tools for Office solution itself. After installing the 
prerequisites and custom components, you can use a custom action to 
install the solution by using ClickOnce with a tool provided by Visual 
Studio Tools for Office.</p><p>The hybrid approach requires the 
following:</p><ul><li class="unordered">
Publish the solution to a location the user can reach using the Publish 
Wizard.<br><br></li><li class="unordered">
Sign the solution with a certificate issued by a trusted publisher, or a
 solution that is in the inclusion list. Otherwise, the ClickOnce 
installation tool returns an error.<br><br></li></ul><p>The custom 
action used to call the Visual Studio Tools for Office ClickOnce 
installation tool is provided in the samples download accompanying this 
article. The custom action calls the ClickOnce tool for the Install and 
Uninstall steps of the installation process. </p>


To add the custom action project to your Visual Studio solution
<ol class="ordered"><li><p>In the <strong>Windows Explorer</strong>, 
navigate to the <strong>{SamplesDir}\projects</strong> folder. </p></li><li><p>Copy
 the <strong>ClickOnceCustomActions</strong> folder from the language 
specific subfolder of your choice to the root folder of your add-in. </p></li><li><p>In
 the <strong>Solution</strong><strong>Explorer</strong>, right-click <strong>the
 Solution VSTO v3 Deployment Demo</strong> solution, expand <strong>Add</strong>
 and click <strong>Existing</strong><strong>Project</strong>. </p></li><li><p>Navigate
 to the folder inside the solution root directory containing the <strong>ClickOnceCustomActions</strong>
 project, select <strong>ClickOnceCustomActions.vbproj</strong> or <strong>ClickOnceCustomActions.csproj</strong>
 and click <strong>Open</strong> to add the project to the solution.</p><br><br><strong>Figure
 36. Solution Explorer - ClickOnce Custom Action</strong><br><br><img 
id="f2a4f012-0200-4a73-ae1c-4d410b31bd99" alt="Solution Explorer" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC133409.jpg"
 title="Solution Explorer" xmlns=""></li></ol><p>You need to add the 
custom action assembly to the setup project. This involves a step 
similar to including the primary add-in assembly. </p>


To configure the setup project
<ol class="ordered"><li><p>In the <strong>Solution Explorer</strong>, 
right-click <strong>ExcelAddInSetup</strong>, click <strong>Add</strong>
 and then <strong>Project Output</strong>.</p></li><li><p>In the <strong>Add
 Project Output Group</strong> dialog box, select the <strong>ClickOnceCustomActions</strong>
 project and the <strong>Primary Output</strong> option. Click <strong>OK</strong>
 to close the dialog box. </p><br><br><strong>Figure 37. ClickOnce 
Custom Action - Add Project Group Dialog Box</strong><br><br><img 
id="3951eed6-9c71-44cd-967c-62d5c4abb2f7" alt="ClickOnce Custom Action" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC52104.jpg"
 title="ClickOnce Custom Action" xmlns=""></li><li><p>Ensure that the 
project output of the ExcelAddIn project (including the manifests) is 
not added to the setup project. This output is no longer necessary 
because ClickOnce is used to deploy these files.</p></li><li><p>In the <strong>Solution
 Explorer</strong>, right-click <strong>ExcelAddInSetup</strong>. Expand
 <strong>View</strong> and click <strong>Custom Actions</strong> to view
 the custom action editor for <strong>ExcelAddInSetup</strong>.</p></li><li><p>In
 the <strong>Custom Actions (ExcelAddInSetup)</strong> editor, 
right-click <strong>Custom Actions</strong> and click <strong>Add Custom
 Action</strong>.</p></li><li><p>In the <strong>Select Item in Project</strong>
 dialog box, in the <strong>Look in</strong> list, click <strong>Application
 Folder</strong>. Select <strong>Primary Output from 
ClickOnceCustomActions(active)</strong> and click <strong>OK</strong> to
 register the custom actions contained in the ClickOnceCustomActions 
assembly for execution during installation of the Windows Installer 
package. </p></li><li><p>In the <strong>Custom Actions(ExcelAddInSetup)</strong>
 editor, under <strong>Install</strong>, right-click <strong>Primary 
Output from ClickOnceCustomActions(Active)</strong> and click <strong>Rename</strong>.
 Name the custom action <strong>Install into ClickOnce cache</strong>.</p></li><li><p>Under
 <strong>Uninstall</strong>, right-click <strong>Primary Output from 
ClickOnceCustomActions(Active)</strong> and click <strong>Rename</strong>.
 Name the custom action <strong>Remove from ClickOnce cache</strong>.</p><br><br><strong>Figure
 38. Excel Add-in Setup Custom Actions</strong><br><br><img 
id="e3368bfd-55fe-460f-94f1-1d82230dd8be" alt="Excell Add-in Setup" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC65330.jpg"
 title="Excell Add-in Setup" xmlns=""></li><li><p>Right-click the <strong>Install
 into ClickOnce cache</strong> custom action and click <strong>Properties</strong>.
 </p></li><li><p>In the <strong>Properties</strong> window, set the 
value of the <strong>CustomActionData</strong> property to the location 
where the ExcelAddIn deploys the Publish Wizard. </p><div class="alert"><table><tbody><tr><th><img
 id="note" alt="Cc616991.note(en-us,office.12).gif" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"
 title="Cc616991.note(en-us,office.12).gif" xmlns="" class="cl_IC101471"><strong>Note:
 </strong></th></tr><tr><td>
 When you use a UNC path you must properly escape some backslash 
characters so the data is available to the custom action. The following 
sample shows how to configure the custom action data with a UNC path to 
the deployment manifest. Note the four slashes at the start of the value
 and the single slash as intermediary separators. This is due to the 
automatic escaping of characters in your custom action data.<br><strong>/deploymentLocation="\\\\ServerName\ShareName\ExcelAddIn.vsto"</strong>.<p></p></td></tr></tbody></table><p></p></div><br><br><strong>Figure
 39. ClickOnce Custom Actions</strong><br><br><img 
id="f5042327-2193-4d44-987b-5ad8f98ebd18" alt="ClickOnce Custom Actions"
 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC101945.jpg"
 title="ClickOnce Custom Actions" xmlns=""></li><li><p>Compile and 
deploy the ExcelAddInSetup project.</p></li></ol></div><a 
id="VSTO3Solutions2_AdaptingtheSetupProjectforWindowsVista"></a><h1 
class="heading">Adapting the Setup Project for Windows Vista</h1><div 
id="sectionSection6" class="section"><p>To install on Microsoft Windows 
Vista with a Windows Installer file, the MSI must be marked as UAC 
compliant, otherwise the user is prompted for the credentials of an 
administrative user. The Windows SDK contains an MSI file editor named 
Orca that you use to mark MSI files as compliant.</p><p>If the Windows 
Installer package is not set to be UAC compliant, the user receives a 
security elevation prompt regardless of the tasks being performed by the
 installer. You must toggle the MSI to be UAC compliant. The ORCA tool 
is used to create a UAC compliant Windows Installer package. The ORCA 
tool is installed when following the "Configuring the developer computer
 for deployment procedure" in Part 1 of this article.</p>


To make the MSI UAC compliant
<ol class="ordered"><li><p>Build the Setup project.</p></li><li><p>Exit 
Visual Studio 2008.</p></li><li><p>Start Orca and open the MSI from the 
build folder of the Setup project.</p></li><li><p>On the <strong>View</strong>
 menu, click <strong>Summary Information</strong>.</p></li><li><p>Click <strong>UAC
 Compliant</strong>.</p><br><br><strong>Figure 40. Orca Tool - UAC 
Compliant</strong><br><br><img id="4a99e067-c0b4-4138-b2e0-f63c9dd8fd5c"
 alt="Orca Tool" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/IC106851.jpg"
 title="Orca Tool" xmlns=""></li><li><p>Click <strong>OK</strong>.</p></li><li><p>On
 the File menu, click <strong>Save</strong>.</p></li><li><p>Close Orca.</p></li></ol></div><a
 id="VSTO3Solutions2_KnownIssues"></a><h1 class="heading">Known Issues</h1><div
 id="sectionSection7" class="section"><p>There is an issue with Visual 
Studio 2008 RTM and registry keys for application-level add-ins. If the 
registry key name used for the Visual Studio Tools for Office solution 
and the name of Visual Studio Tools for Office project inside Visual 
Studio are the same, then during build time Visual Studio 2008 
overwrites the value for the manifest so it matches the Visual Studio 
2005 SE manifest format. To avoid this issue make sure that the registry
 key name differs from the project name such as CompanyName.AddinName. 
This issue is resolved with Visual Studio 2008 SP1.</p></div><a 
id="VSTO3Solutions2_AdditionalResources"></a><h1 class="heading">Additional
 Resources</h1><div id="sectionSection8" class="section"><p><a 
href="http://msdn.microsoft.com/en-us/library/cc563937%28v=office.12%29.aspx">Deploying
 a Visual Studio Tools for the Office System 3.0 Solution for the 2007 
Microsoft Office System Using Windows Installer (Part 1 of 2)</a></p><p><span
 class="unresolvedLink">Deploying Solutions for 2007 Office System with 
ClickOnce Using Visual Studio Tools for the Office System (3.0)</span></p><p><a
 
href="http://msdn.microsoft.com/en-us/library/bb821233%28v=office.12%29.aspx">Deploying
 Solutions for the 2007 Office System with ClickOnce Using Visual Studio
 2008 Professional</a></p><p><a 
href="http://msdn.microsoft.com/en-us/library/ms178739.aspx">How to: 
Install the Visual Studio Tools for Office Runtime</a></p><p><a 
href="http://msdn.microsoft.com/en-us/library/15s06t57.aspx">Office 
Primary Interop Assemblies</a></p><p><a 
href="http://msdn.microsoft.com/en-us/library/bb386106.aspx">Registry 
Entries for Application-Level Add-Ins</a></p><p><a 
href="http://msdn.microsoft.com/en-us/library/ds87aeyf.aspx">Custom 
Document Properties Overview</a></p><p><span class="unresolvedLink">Specifying
 Form Regions in the Windows Registry</span></p><p><a 
href="http://msdn.microsoft.com/en-us/library/bb772072.aspx">Granting 
Trust to Documents (2007 System)</a></p></div><a 
id="VSTO3Solutions2_AbouttheAuthors"></a><h1 class="heading">About the 
Authors</h1><div id="sectionSection9" class="section"><p>Wouter van Vugt
 is a Microsoft MVP with Office Open XML technologies and an independent
 consultant focusing on creating Office Business Applications (OBAs) 
with SharePoint, the Office 2007 system and related .NET technologies. 
Wouter is a frequent contributor to developer community sites such as <a
 href="http://openxmldeveloper.org/">OpenXmlDeveloper.org</a>and <a 
href="http://msdn2.microsoft.com/en-us/library/bb879915.aspx" 
target="_blank">MSDN</a>. He has published several white papers and 
articles as well a book available on line titled <span 
class="unresolvedLink">Open XML: Explained e-book</span>. Wouter is the 
founder of Code-Counsel, a Dutch company focusing on delivering 
cutting-edge technical content through a variety of channels. You can 
find out more about Wouter by reading his <span class="unresolvedLink">blog</span>
 and visiting the <a href="http://www.code-counsel.net/">Code-Counsel 
Web site</a>. </p><p>Ted Pattison is a SharePoint MVP, author, trainer 
and the founder of Ted Pattison Group. In the fall of 2005, Ted was 
hired by Microsoft’s Developer Platform Evangelism group to author the 
Ascend developer training curriculum for Windows SharePoint Services 3.0
 and Microsoft Office SharePoint Server 2007. Since that time, Ted has 
been entirely focused on educating professional developers on SharePoint
 2007 technologies. Ted has just finished writing a book for Microsoft 
Press titled <span class="unresolvedLink">Inside Windows SharePoint 
Services 3.0</span> that focuses on how to use SharePoint as a 
development platform for building business solutions. Ted also writes a 
developer-focused column for MSDN Magazine titled <span 
class="unresolvedLink">Office Space</span>.</p></div></div></div></div></div><div
 class="topicEndLine"></div><div id="CommunityContent" 
class="CommunityContent"><div class="CommunityContentContainer"><div 
id="CommunityContentHeader" class="CommunityContentHeader"><div 
class="CommunityContentHeaderTitleContainer"><span 
class="CommunityContentHeaderTitle h1">Community Content</span><a 
href="http://msdn.microsoft.com/en-us/library/community/add/cc616991%28v=office.12%29.aspx"
 title="Add">Add</a></div><div class="CommunityContentFaq"><a 
href="http://msdn.microsoft.com/en-us/library/community-edits.rss?topic=cc616991%7Cen-us%7Coffice.12"
 title="Annotations"><img class="cl_rss_button" alt="Annotations" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"></a><a
 
href="http://msdn.microsoft.com/en-us/library/community-msdnwikifaq.aspx"
 title="FAQ">FAQ</a></div><div style="clear: both;"></div></div><div 
class="Annotation"><a name="4"></a><div class="AnnotationTitle h3"><span>Missing
 spaces for Document-level solution causes installation problem </span></div><div
 class="AnnotationBody"><p>Step 11 of "<a>Additional Requirements for 
Document-level Solutions</a>" can cause some problems because the space 
is lost.  &amp;nbsp; should be insterted between parameters.<br></p><p><br></p><p><br></p><p>11.
  In the <strong>Properties</strong> window, for the <strong>CustomActionData</strong>
property, enter the following values. This passes in the location of
the customization DLL, the location of the deployment manifest and the
location of the Microsoft Office document. Note that the following text
has been wrapped. </p><span><div><div></div><div dir="ltr"><pre space="preserve">        <br>/assemblyLocation="[TARGETDIR]ExcelDocumentSolution.d<b>ll"/de</b>ploymentManifestLocation="[TARGETDIR]ExcelDocumentSolution.vs<b>to"/d</b>ocumentLocation="[TARGETDIR]ExcelDocumentSolution.xlsx"<br></pre></div></div></span></div><div
 class="AnnotationHistory"><a 
href="http://msdn.microsoft.com/en-us/library/community/history/cc616991%28v=office.12%29.aspx?id=4"
 title="History" target="_blank">History</a></div><div 
class="HistoryGraphic"><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"
 class="cl_rt_cc_line_top" alt=""></div><div class="ModificationHistory"><div
 class="AnnotationAddedContainer"><a class="AddedUserAvatar" 
href="http://msdn.microsoft.com/en-us/library/community/user/837533.aspx"
 title=""><img alt="" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/Image_003.avatr"
 height="34" width="34"></a><ul class="AddedUserData"><li>10/19/2009</li><li><a
 
href="http://msdn.microsoft.com/en-us/library/community/user/837533.aspx">Steve
 Thiakos</a></li></ul></div></div></div><div class="AnnotationComplete 
cl_nav_offline_nav_slice"></div><div class="Annotation"><a name="3"></a><div
 class="AnnotationTitle h3"><span>How to install Addins for all users </span></div><div
 class="AnnotationBody">
            This post should be part of the documentation:<br><a>http://blogs.msdn.com/mshneer/archive/2008/04/24/deploying-your-vsto-add-in-to-all-users-part-iii.aspx</a><br></div><div
 class="AnnotationHistory"><a 
href="http://msdn.microsoft.com/en-us/library/community/history/cc616991%28v=office.12%29.aspx?id=3"
 title="History" target="_blank">History</a></div><div 
class="HistoryGraphic"><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"
 class="cl_rt_cc_line_top" alt=""></div><div class="ModificationHistory"><div
 class="AnnotationAddedContainer"><a class="AddedUserAvatar" 
href="http://msdn.microsoft.com/en-us/library/community/user/95668.aspx"
 title=""><img alt="" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/Image_002.avatr"
 height="34" width="34"></a><ul class="AddedUserData"><li>2/17/2009</li><li><a
 
href="http://msdn.microsoft.com/en-us/library/community/user/95668.aspx">David
 Hernández Díez</a></li></ul></div><div 
class="AnnotationEditedContainer"><a class="EditedUserAvatar" 
href="http://msdn.microsoft.com/en-us/library/community/user/42770.aspx"
 title=""><img alt="" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/Image.avatr"
 height="25" width="25"></a><ul><li>
              3/14/2009
              </li><li><a 
href="http://msdn.microsoft.com/en-us/library/community/user/42770.aspx">Thomas
 Lee</a></li></ul></div></div></div><div class="AnnotationComplete 
cl_nav_offline_nav_slice"></div><div class="Annotation"><a name="2"></a><div
 class="AnnotationTitle h3"><span>The xlsx file opened with error when 
copied to a different location... </span></div><div 
class="AnnotationBody"><p>Hi,</p><p></p><p>The article is great!. I 
installed the customization and can open it successfully if I open 
ExcelDocumentSolution.xlsx file from the same location where .vsto and 
.dll files are located.</p><p></p><p>If I copy the 
ExcelDocumentSolution.xlsx in a different directory, say, c:\temp, I get
 the following error,</p><p></p><p>Name: <br>From: 
file:///C:/temp/ExcelDocumentSolution.vsto<br><br>Downloading 
file:///C:/temp/ExcelDocumentSolution.vsto did not succeed. I thought 
after I install the customization, I can copy the file into any location
 and work with the file... Could some one please help to resolve this 
issue?<br><br>************** Exception Text **************<br>System.Deployment.Application.DeploymentDownloadException:
 Downloading file:///C:/temp/ExcelDocumentSolution.vsto did not succeed.
 ---&gt; System.Net.WebException: Could not find file 
'C:\temp\ExcelDocumentSolution.vsto'. ---&gt; System.Net.WebException: 
Could not find file 'C:\temp\ExcelDocumentSolution.vsto'. ---&gt; 
System.IO.FileNotFoundException: Could not find file 
'C:\temp\ExcelDocumentSolution.vsto'.<br>File name: 
'C:\temp\ExcelDocumentSolution.vsto'<br>   at 
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)<br> 
  at System.IO.FileStream.Init(String path, FileMode mode, FileAccess 
access, Int32 rights, Boolean useRights, FileShare share, Int32 
bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String 
msgPath, Boolean bFromProxy)<br>   at System.IO.FileStream..ctor(String 
path, FileMode mode, FileAccess access, FileShare share, Int32 
bufferSize, Boolean useAsync)<br>   at 
System.Net.FileWebStream..ctor(FileWebRequest request, String path, 
FileMode mode, FileAccess access, FileShare sharing, Int32 length, 
Boolean async)<br>   at System.Net.FileWebResponse..ctor(FileWebRequest 
request, Uri uri, FileAccess access, Boolean asyncHint)<br>   --- End of
 inner exception stack trace ---<br>   at 
System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, 
FileAccess access, Boolean asyncHint)<br>   at 
System.Net.FileWebRequest.GetResponseCallback(Object state)<br>   --- 
End of inner exception stack trace ---<br>   at 
System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)<br>  
 at System.Net.FileWebRequest.GetResponse()<br>   at 
System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem
 next)<br>   --- End of inner exception stack trace ---<br>   at 
Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.GetManifests(TimeSpan
 timeout)<br>   at 
Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()</p><p></p><p></p></div><div
 class="AnnotationHistory"><a 
href="http://msdn.microsoft.com/en-us/library/community/history/cc616991%28v=office.12%29.aspx?id=2"
 title="History" target="_blank">History</a></div><div 
class="HistoryGraphic"><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"
 class="cl_rt_cc_line_top" alt=""></div><div class="ModificationHistory"><div
 class="AnnotationAddedContainer"><a class="AddedUserAvatar" 
href="http://msdn.microsoft.com/en-us/library/community/user/283782.aspx"
 title=""><img alt="" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/Image_005.avatr"
 height="34" width="34"></a><ul class="AddedUserData"><li>11/4/2008</li><li><a
 
href="http://msdn.microsoft.com/en-us/library/community/user/283782.aspx">kriskk</a></li></ul></div></div></div><div
 class="AnnotationComplete cl_nav_offline_nav_slice"></div><div 
class="Annotation"><a name="1"></a><div class="AnnotationTitle h3"><span>Space
 separator in CustomActionData string </span></div><div 
class="AnnotationBody"><p>There is an error in the CustomActionData 
string as provided in the text (here emphasized in Bold and Underscore):</p><p>/assemblyLocation="[TARGETDIR]ExcelDocumentSolution.dll<strong><u>"/</u></strong>deploymentManifestLocation="[TARGETDIR]ExcelDocumentSolution.vsto<strong><u>"/</u></strong>documentLocation="[TARGETDIR]ExcelDocumentSolution.xlsx"</p><p>Each
 parameter passed in the CustomActionData string must be separated by 
spaces. In order to fix the CustomActionData string replace it with:</p><p>/assemblyLocation="[TARGETDIR]ExcelDocumentSolution.dll"
 /deploymentManifestLocation="[TARGETDIR]ExcelDocumentSolution.vsto" 
/documentLocation="[TARGETDIR]ExcelDocumentSolution.xlsx"</p></div><div 
class="AnnotationHistory"><a 
href="http://msdn.microsoft.com/en-us/library/community/history/cc616991%28v=office.12%29.aspx?id=1"
 title="History" target="_blank">History</a></div><div 
class="HistoryGraphic"><img 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/030c41d9079671d09a62d8e2c1db6973.gif"
 class="cl_rt_cc_line_top" alt=""></div><div class="ModificationHistory"><div
 class="AnnotationAddedContainer"><a class="AddedUserAvatar" 
href="http://msdn.microsoft.com/en-us/library/community/user/26710.aspx"
 title=""><img alt="" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/Image_004.avatr"
 height="34" width="34"></a><ul class="AddedUserData"><li>11/2/2008</li><li><a
 
href="http://msdn.microsoft.com/en-us/library/community/user/26710.aspx">Maarten
 van Stam</a></li></ul></div><div class="AnnotationEditedContainer"><a 
class="EditedUserAvatar" 
href="http://msdn.microsoft.com/en-us/library/community/user/26710.aspx"
 title=""><img alt="" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/Image_004.avatr"
 height="25" width="25"></a><ul><li>
              11/2/2008
              </li><li><a 
href="http://msdn.microsoft.com/en-us/library/community/user/26710.aspx">Maarten
 van Stam</a></li></ul></div></div></div><div class="AnnotationComplete 
cl_nav_offline_nav_slice"></div></div></div></div></div><div 
class="footer"><div id="footer" class="footerContainer cl_footer_slice"><div
 class="footerLogoContainer"><div class="footerContent"><div 
class="copyright">
      © 2010 Microsoft Corporation. All rights reserved.</div><div 
class="footerLogo cl_footer_logo"></div><a 
href="http://msdn.microsoft.com/cc300389.aspx">Terms of Use</a><span 
class="pipe"> | </span><a 
href="http://www.microsoft.com/library/toolbar/3.0/trademarks/en-us.mspx">Trademarks</a><span
 class="pipe"> | </span><a 
href="http://www.microsoft.com/info/privacy.mspx">Privacy Statement</a><span
 class="pipe">| </span><a onclick="javascript:ShowFeedbackDialog();" 
title="Feedback" class="FeedbackLink" href="#footerLink">
      Feedback
        <span class="FeedbackButton clip20x21" id="FeedbackButton"><img 
class="cl_footer_feedback_icon" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 alt="Feedback"></span></a><div id="FeedbackContainer" 
class="FeedbackContainer"><form method="post" 
action="/en-us/library/feedback/add/cc616991(v=office.12).aspx"><div 
class="FeedbackTitleContainer"><div class="FeedbackTitle">
            Feedback</div><div class="FeedbackCancel"><a 
href="javascript:;" 
onclick="document.getElementById('FeedbackContainer').style.display = 
'none';">x</a></div></div><div class="FeedbackData"><div 
class="FeedbackInfoText">
            Tell us about your experience...
        </div><div class="QuestionText">
            Did the page load quickly?
        </div><div class="AnswerText"><span>
                Yes<span><input id="searchBox" name="searchBox" 
value="1" type="radio"></span></span><span>
                No<span><input id="searchBox" name="searchBox" value="0"
 type="radio"></span></span></div><div class="QuestionText">
            Do you like the page design?
        </div><div class="AnswerText"><span>
                Yes<span><input id="tabbedCode" name="tabbedCode" 
value="1" type="radio"></span></span><span>
                No<span><input id="tabbedCode" name="tabbedCode" 
value="0" type="radio"></span></span></div><div class="QuestionText">
            How useful is this topic?
        </div><div class="FeedbackGraphicHolder clip269x23"><img alt="" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/0988b66c1e448ee567fca35fa16b4f24.png"
 class="cl_online_scale FeedbackSiderGraphic"></div><div 
class="RadioButtonHolder"><div class="RateRadioOne"><input 
id="topicUseful" name="topicUseful" title="Really disliked it" value="1"
 type="radio"></div><div class="RateRadio"><input id="topicUseful" 
name="topicUseful" title="Disliked it" value="2" type="radio"></div><div
 class="RateRadio"><input id="topicUseful" name="topicUseful" title="OK"
 value="3" type="radio"></div><div class="RateRadio"><input 
id="topicUseful" name="topicUseful" title="Good" value="4" type="radio"></div><div
 class="RateRadioLast"><input id="topicUseful" name="topicUseful" 
title="Really Good" value="5" type="radio"></div></div><div 
class="QuestionText">
            Tell us more
        </div><div class="FeedbackTextAreaContainer"><textarea 
name="feedbackText" cols="25" rows="5" class="FeedbackTextArea" 
onkeyup="LimitText(this, 4000);" onkeydown="LimitText(this, 4000);"></textarea><textarea
 id="feedbackDescription" name="feedbackDescription" cols="25" rows="10"
 style="display: none;" onkeyup="LimitText(this, 4000);" 
onkeydown="LimitText(this, 4000);">Enter description here.</textarea><input
 id="feedbackPriority" name="feedbackPriority" value="" type="hidden"><input
 id="feedbackSourceUrl" name="feedbackSourceUrl" value="" type="hidden"><input
 id="ClientIP" name="ClientIP" value="" type="hidden"><input 
id="ClientOS" name="ClientOS" value="" type="hidden"><input 
id="ClientBrowser" name="ClientBrowser" value="" type="hidden"><input 
id="ClientTime" name="ClientTime" value="" type="hidden"><input 
id="ClientTimeZone" name="ClientTimeZone" value="" type="hidden"></div><div><input
 value="Send" class="FeedbackSubmit" 
onclick="document.getElementById('feedbackDescription').value='';document.getElementById('feedBackVersion').value
 = '-1';" type="submit"></div></div><input id="returnUrl" 
name="returnUrl" 
value="http://msdn.microsoft.com/en-us/library/cc616991(v=office.12).aspx"
 type="hidden"><input id="feedBackVersion" name="feedBackVersion" 
value="1" type="hidden"></form></div></div></div></div></div><div 
class="MetricsContainer"><div class="WebtrendsContainer"><script type="text/javascript" language="javascript">
//<![CDATA[
  var literalNormalizedUrl = '/en-us/library/cc616991(d=lightweight,l=en-us,v=office.12).aspx';
  var wt_nvr_ru = 'WT_NVR_RU';
  var wt_fpcdom = '.microsoft.com';
  var wt_domlist = 'msdn.microsoft.com';
  var wt_pathlist = '';
  var wt_paramlist = 'DCSext.mtps_devcenter';
  var wt_siteid = 'MSDN';
  var gDomain = 'm.webtrends.com';
  var gDcsId = 'dcsmgru7m99k7mqmgrhudo0k8_8c6m';
  var gFpc = 'WT_FPC';
  if (document.cookie.indexOf(gFpc + "=") == -1) {
    document.write("<scr" + "ipt type='text/javascript' src='" + "http" + (window.location.protocol.indexOf('https:') == 0 ? 's' : '') + "://" + gDomain + "/" + gDcsId + "/wtid.js" + "'><\\/scr" + "ipt>");
  }
  var detectedLocale = 'en-us';
  var wtsp = 'msdnlib_hp';
  var gTrackEvents = '0';
/*]]>*/
</script><noscript><div><img alt="DCSIMG" id="Img1" width="1" height="1" src="http://m.webtrends.com/dcsmgru7m99k7mqmgrhudo0k8_8c6m/njs.gif?dcsuri=/nojavascript&amp;WT.js=No" /></div></noscript></div><div
 class="OmnitureContainer"><script type="text/javascript">
  var omni_guid = '54142197-7912-4852-bee7-65f9a8bf1197'; 
</script><noscript><a href="http://www.omniture.com" title="Web Analytics"><img src="http://msstonojsmsdn.112.2o7.net/b/ss/msstonojsmsdn/1/H.20.2--NS/0" height="1" width="1" border="0" alt="" /></a></noscript></div><div
 class="WebMetrixContainer"><div class="MetricsContainer"><img alt="Page
 view tracker" 
src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/trans_pixel.gif"
 border="0" height="0" width="0"></div></div></div><script language="javascript" type="text/javascript" src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/broker.js"></script><script type="text/javascript" src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/b20574176f2d4b6028665a10d8a51cdc.js" xmlns="http://www.w3.org/1999/xhtml"></script><script src="Deploying%20a%20Visual%20Studio%20Tools%20for%20the%20Office%20System%203.0%20Solution%20for%20the%202007%20Microsoft%20Office%20System%20Using%20Windows%20Installer%20%28Part%202%20of%202%29_files/broker-config.js"></script></body></html>